package cn.funnymap.lgis.file.excel;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * @author jiaoxn
 */
@Data
public class ExcelTreeItem {
    private String value;
    private List<ExcelTreeItem> children;

    public ExcelTreeItem() {
        this.value = null;
        this.children = new ArrayList<>();
    }

    public ExcelTreeItem(String value) {
        this.value = value;
        this.children = new ArrayList<>();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        ExcelTreeItem obj = (ExcelTreeItem) o;

        return Objects.equals(this.value, obj.value);
    }

    @Override
    public int hashCode() {
        return this.value.hashCode();
    }
}
